<!DOCTYPE html>
<html lang="en">
<head>
    <title>博客添加</title>
<#include "../../comm/meta-base.ftl" />
<#include "../../comm/meta-bootstrap.ftl" />
<#include "../../comm/meta-summernote.ftl" />
<#include "../../comm/meta-layui.ftl" />

    <link rel="stylesheet" href="/static/css/index.css" media="all"/>
</head>
<body class="blog blog_add_edit">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>博客添加</legend>
</fieldset>

<form class="layui-form layui-form-pane" action="/admin/blog/save_and_edit" method="post">
    <input type="hidden" name="blogId" value="${blog.blogId}">
    <div class="layui-form-item blog_line_1">
        <div class="layui-inline">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-inline">
                <input value="${blog.title}" type="text" name="title" lay-verify="required" placeholder="请输入标题"
                       autocomplete="off" class="layui-input"/>
            </div>
        </div>
        <div class="layui-inline blog_line_1_1">
            <label class="layui-form-label">分组</label>
            <div class="layui-input-inline">
                <select name="groupId">
                    <option value="">请选择分组</option>
                <#list groups as item>
                    <#if item.groupId == blog.groupId>
                        <option value="${item.groupId}" selected>${item.name}</option>
                    <#else>
                        <option value="${item.groupId}">${item.name}</option>
                    </#if>
                </#list>
                </select>
            </div>
        </div>
        <a onclick="group_add()" class="layui-btn layui-btn-primary layui-btn-small blog_line_1_2"><i
                class="layui-icon"></i></a>
    </div>
    <div class="layui-form-item layui-form-text blog_edit">
        <label class="layui-form-label">编辑器</label>
        <div class="layui-input-block">
        <#--<textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="LAY_demo_editor"></textarea>-->
            <div id="summernote">${blog.content}</div>
            <input type="hidden" name="content" value="${blog.content}" lay-verify="content"/>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="save_blog">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<div id="page"></div>
</body>
<script type="text/javascript" src="/static/js/blog.js"></script>
</html>